package cn.cau.service.impl;

import cn.cau.dao.CodeManageDao;
import cn.cau.dao.CodeRuleDao;
import cn.cau.entity.CodeRule;
import cn.cau.entity.CodeManageRecord;
import cn.cau.service.CodeManageAbolishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CodeManageAbolishServiceImpl implements CodeManageAbolishService {
    @Autowired
    private CodeRuleDao codeRuleDao;
    @Autowired
    private CodeManageDao codeManageDao;

    @Override
    public int submitCodeRuleAbolish(CodeManageRecord codeManageRecord) {
        return codeManageDao.insertManageApplication(codeManageRecord);
    }

    @Override
    public List<CodeRule> showCodeRuleAbolishList(int userId) {
        return codeRuleDao.findLiveCodeRuleByuserId(userId);
    }
    @Override
    public CodeManageRecord findRecordByNewCodeRuleId(int codeRuleId){
        return codeManageDao.findRecordByNewCodeRuleId(codeRuleId);
    }

}
